Skip to content

Add CLIProxyAPI cost attribution - #2457

Open
EClinick wants to merge 128 commits into
steipete:mainfrom
EClinick:task/ec/codex-proxy-attribution
Open

Add CLIProxyAPI cost attribution#2457
EClinick wants to merge 128 commits into
steipete:mainfrom
EClinick:task/ec/codex-proxy-attribution

Conversation

@EClinick

@EClinick EClinick commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • attribute Claude Code sessions routed through CLIProxyAPI using endpoint, installation, inventory, and request-log evidence
  • price confirmed proxied GPT usage in Codex totals while preserving route, backend, and auth provenance
  • surface proxy attribution in the spend dashboard and collect bounded CLIProxyAPI telemetry
  • serialize destructive telemetry collection and preserve full dashboard and synthetic-project attribution identities
  • keep proxy telemetry present for scoped callers while loading it exactly once beside account-scoped dashboard sources
  • persist each destructive queue batch before the next pop and surface cache-write failures
  • enforce the 366-day telemetry retention cutoff even when the proxy queue is empty
  • preserve request-log attribution beyond the newest 500 files
  • load the siloed proxy source for Claude-only dashboard configurations
  • retain Claude-only proxy spend through forced-refresh reconciliation
  • skip telemetry cache rewrites when an empty queue poll leaves the cache unchanged
  • filter expired telemetry during cache reads even when collection is unavailable
  • make request-log attribution loading cancellation-aware in full and cached scan paths
  • price aliased proxy usage from the telemetry-resolved upstream model
  • quarantine unresolved known foreign models from Claude totals while preserving confirmed non-Codex proxy attribution
  • refresh and retry proxy-only scans when a telemetry-confirmed upstream model is still unpriced
  • request refreshed pricing for the telemetry-resolved upstream model when its Claude-facing alias differs
  • resolve OpenAI-compatible proxy models across vendor catalogs after refresh instead of treating transport as vendor
  • keep global CLIProxyAPI supplemental usage out of account-scoped Codex scans
  • index retained proxy telemetry by canonical model and binary-search its bounded timestamp window
  • cache parsed CLIProxyAPI request logs by path, modification date, and size while pruning deleted paths
  • preserve explicit full-rescan semantics by bypassing the request-log cache when forced
  • resolve the default CLIProxyAPI home when hydrating cached spend through the production cache-root initializer
  • prefer timestamped request-log observations over undated fallbacks during telemetry correlation
  • migrate cost caches and add cross-provider regression coverage

Verification

  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer make check
  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer SWIFT_MODULECACHE_PATH=/tmp/codexbar-swift-module-cache CLANG_MODULE_CACHE_PATH=/tmp/codexbar-clang-module-cache make test (929 selections, 78 groups, all passed on the first attempt; 0 retries/timeouts)
  • swift test --filter SpendDashboardProxyAttributionTests
  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer swift test --filter CLIProxyAPIAttributionResolverTests (24 tests)
  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer swift test --filter CostUsageFetcherCacheSnapshotTests (13 tests)
  • swift test --filter CostUsageFetcherTests (18 tests)
  • focused resolver and fetcher suites together (40 tests)
  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer swift test --filter CostUsageFetcherUnknownModelPricingTests (7 tests)
  • swift test --filter SpendDashboardCodexProxySourceTests (2 tests)
  • swift test --filter SpendDashboardForceStateMachineTests (14 tests)
  • focused resolver, proxy-source, and dashboard-controller suites (47 tests)
  • focused SpendDashboardTokenProvenanceTests, SpendDashboardControllerTests, CostUsageCacheTests, and CostUsageScannerClaudeFableTests

Remaining proof

  • A redacted live CLIProxyAPI-routed Claude Code run has not been collected in this PR. Automated tests use isolated fixtures and stubbed queue clients; they do not claim production-account or Keychain validation.

Copilot AI review requested due to automatic review settings July 25, 2026 23:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c82dab5a6d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/CLIProxyAPIAttributionResolver.swift Outdated
Comment thread Sources/CodexBarCore/CLIProxyAPIUsageTelemetry.swift Outdated
Comment thread Sources/CodexBar/SpendDashboardModel.swift Outdated
Comment thread Sources/CodexBarCore/CostUsageFetcher.swift
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Jul 26, 2026
@clawsweeper

clawsweeper Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed August 21, 2026, 10:00 AM ET / 14:00 UTC.

ClawSweeper review

What this changes

Adds CLIProxyAPI telemetry, upstream-provider attribution, caching, and spend-dashboard display for proxied Claude Code usage.

Merge readiness

Blocked until real behavior proof from a real setup is added - 9 items remain

Keep open: two P2 correctness defects remain on the exact head, and the contributor has not supplied the required redacted live routed-run proof.

Priority: P2
Reviewed head: 68c572034e31bb7d7e77e8ad32e126eb74349e69
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) Substantial focused tests exist, but two P2 persistence defects and missing real behavior proof prevent merge readiness.
Proof confidence 🧂 unranked krab (1/6) Needs real behavior proof before merge: Fixture and stubbed-client tests are useful supplemental evidence, but the PR explicitly lacks a redacted real CLIProxyAPI-routed after-fix dashboard run; redact private endpoints and credentials in that proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦪 silver shellfish (2/6) 2 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: Fixture and stubbed-client tests are useful supplemental evidence, but the PR explicitly lacks a redacted real CLIProxyAPI-routed after-fix dashboard run; redact private endpoints and credentials in that proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Current main lacks this integration: The current-main tree has none of the new CLIProxyAPI attribution, telemetry, or cache-location source files, so the central feature is not already implemented.
Memo fast path misses generation recheck: A memoized Claude report returns without validating that the captured CLIProxyAPI generation still matches, unlike the rebuilt-report path.
Removal recovery cannot distinguish pre-existing isolation: The manifest does not record whether this removal created the disconnect marker, but recovery treats any present marker as deletion proof and discards staged telemetry.
Findings 2 actionable findings [P2] Recheck the proxy generation before returning a memoized report
[P2] Record removal-specific isolation before treating it as deletion proof
Security None None.

How this fits together

CodexBar combines Claude Code history with CLIProxyAPI logs and queue telemetry, resolves the upstream provider and model, then prices and displays that usage in the spend dashboard.

flowchart LR
A[Claude Code history] --> C[Attribution resolver]
B[CLIProxyAPI logs and telemetry] --> C
C --> D[Provider and model pricing]
D --> E[Cost cache]
E --> F[Spend dashboard]
Loading

Decision needed

Question Recommendation
Should CodexBar own this built-in CLIProxyAPI credential, telemetry, and spend-attribution integration at its current scope? Sponsor a narrowed core integration: Accept the direction after the correctness defects and live proof are addressed, while keeping credential handling and provider attribution tightly scoped.

Why: The PR adds a large new provider-integration and configuration surface, so its long-term core ownership and scope need maintainer intent beyond mechanical fixes.

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: Fixture and stubbed-client tests are useful supplemental evidence, but the PR explicitly lacks a redacted real CLIProxyAPI-routed after-fix dashboard run; redact private endpoints and credentials in that proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Recheck the proxy generation before returning a memoized report (P2) - A replacement or removal can advance the durable generation after reportKey is built but before this return. Unlike the rebuild path below, this fast path never enters the locked generation checks, so it can publish attribution from the prior configuration. Revalidate the captured generation before returning the memoized report and add the race regression.
  • Record removal-specific isolation before treating it as deletion proof (P2) - The recovery branch treats any disconnect marker as proof this removal reached credential deletion. If the marker predated this transaction and the process exits before clearConfiguration(), the old credential remains but staged telemetry is discarded. Persist whether this transaction published isolation, or otherwise distinguish the pre-existing marker, and cover that crash boundary.
  • Resolve merge risk (P1) - A proxy replacement or removal can briefly publish memoized attribution from the previous configuration.
  • Resolve merge risk (P1) - An interrupted removal can discard telemetry while retaining a credential that was already isolated before the removal began.
  • Complete next step (P2) - A maintainer needs to confirm whether this large built-in credential and telemetry integration belongs in core; the contributor can independently fix the two findings and add proof.
  • Improve patch quality - Fix both recovery and memo-generation findings with focused regressions.
  • Improve patch quality - Attach a redacted live CLIProxyAPI-routed Claude Code run showing after-fix dashboard attribution, then update the PR body for re-review.

Findings

  • [P2] Recheck the proxy generation before returning a memoized report — Sources/CodexBarCore/Vendored/CostUsage/CostUsageScanner+Claude.swift:1043-1049
  • [P2] Record removal-specific isolation before treating it as deletion proof — Sources/CodexBarCore/CostUsageCacheLocations.swift:441-450
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Scope 44 files affected; production +5,134, tests +6,207 This is a large persisted-state and provider-attribution change, making recovery proof especially important.

Merge-risk options

Maintainer options:

  1. Repair recovery and memo validation (recommended)
    Add the two narrow state checks and regressions before merge to avoid stale attribution and unsafe interrupted-removal recovery.
  2. Pause for scope review
    Pause if maintainers do not want this credential-bearing CLIProxyAPI integration in the core app at its current scope.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Add focused regressions for the memo generation race and pre-existing disconnect-marker removal recovery; retain existing credential-isolation guarantees.

Technical review

Best possible solution:

Persist removal-specific isolation provenance, recheck generation before memo returns, add focused crash/race regressions, and then provide a redacted live routed-run proof.

Do we have a high-confidence way to reproduce the issue?

Yes, at source level: advancing the durable generation during a memo return and starting removal with an existing disconnect marker exercise the two missing state checks; live provider proof remains absent.

Is this the best way to solve the issue?

No: the current approach needs durable removal-specific isolation provenance and memo-path generation validation before it is safe to merge.

Full review comments:

  • [P2] Recheck the proxy generation before returning a memoized report — Sources/CodexBarCore/Vendored/CostUsage/CostUsageScanner+Claude.swift:1043-1049
    A replacement or removal can advance the durable generation after reportKey is built but before this return. Unlike the rebuild path below, this fast path never enters the locked generation checks, so it can publish attribution from the prior configuration. Revalidate the captured generation before returning the memoized report and add the race regression.
    Confidence: 0.98
  • [P2] Record removal-specific isolation before treating it as deletion proof — Sources/CodexBarCore/CostUsageCacheLocations.swift:441-450
    The recovery branch treats any disconnect marker as proof this removal reached credential deletion. If the marker predated this transaction and the process exits before clearConfiguration(), the old credential remains but staged telemetry is discarded. Persist whether this transaction published isolation, or otherwise distinguish the pre-existing marker, and cover that crash boundary.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against f74117aeb7a9.

Labels

Label justifications:

  • P2: The remaining defects affect optional attribution and removal recovery rather than core availability.
  • merge-risk: 🚨 compatibility: The branch changes persisted cost-cache and recovery behavior across existing installations.
  • merge-risk: 🚨 auth-provider: The removal flow can leave a CLIProxyAPI credential masked or active with incorrect telemetry state.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Fixture and stubbed-client tests are useful supplemental evidence, but the PR explicitly lacks a redacted real CLIProxyAPI-routed after-fix dashboard run; redact private endpoints and credentials in that proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Current-main blame ties the Claude cost-scanner surface adjacent to this attribution work to the latest released main revision. (role: current-main area contributor; confidence: medium; commits: 22a2168842a9; files: Sources/CodexBarCore/Vendored/CostUsage/CostUsageScanner+Claude.swift)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (119 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-08T16:56:33.311Z sha c694017 :: needs real behavior proof before merge. :: [P2] Invalidate the proxy source when its load is cancelled
  • reviewed 2026-08-08T17:10:37.046Z sha c694017 :: needs real behavior proof before merge. :: [P2] Invalidate the proxy source after a cancelled load
  • reviewed 2026-08-08T22:58:33.064Z sha c694017 :: needs real behavior proof before merge. :: [P2] Invalidate the proxy source after a cancelled scan
  • reviewed 2026-08-09T05:44:16.041Z sha c694017 :: needs real behavior proof before merge. :: [P2] Invalidate the proxy source after a cancelled scan
  • reviewed 2026-08-09T13:41:06.621Z sha 8441b9a :: needs real behavior proof before merge. :: [P1] Rebase proxy persistence onto the current SQLite cost store
  • reviewed 2026-08-09T14:16:07.984Z sha 8441b9a :: needs real behavior proof before merge. :: [P1] Rebase proxy persistence onto the SQLite cost store
  • reviewed 2026-08-12T09:14:46.594Z sha 8441b9a :: needs real behavior proof before merge. :: [P1] Port proxy cache reads to CostUsageStore
  • reviewed 2026-08-21T03:44:53.945Z sha 0f971ca :: needs real behavior proof before merge. :: [P2] Record credential removal before finalizing the purge

Copy link
Copy Markdown
Contributor Author

@codex review

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 27, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c3bedb05f8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/CostUsageFetcher.swift Outdated
Comment thread Sources/CodexBarCore/CLIProxyAPIUsageTelemetry.swift Outdated
Comment thread Sources/CodexBarCore/CLIProxyAPIUsageTelemetry.swift Outdated

Copy link
Copy Markdown
Contributor Author

Follow-up fixes are pushed in 0f4bda0 and the three current review threads have been addressed.

@codex review
@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 27, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0f4bda0d9a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/CLIProxyAPIUsageTelemetry.swift Outdated

Copy link
Copy Markdown
Contributor Author

The current-head retention finding is fixed in e9b111e and its review thread is addressed.

@codex review
@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 27, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e9b111ef6c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/CLIProxyAPIAttributionResolver.swift Outdated
Comment thread Sources/CodexBar/SpendDashboardController.swift Outdated
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 27, 2026
@EClinick

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@EClinick

Copy link
Copy Markdown
Contributor Author

@codex review

@clawsweeper

clawsweeper Bot commented Jul 27, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 session-state 🚨 Merging this PR could lose, corrupt, stale, or mis-associate session or agent state. labels Aug 4, 2026
@EClinick

EClinick commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Fixed both rollback findings from the canonical ClawSweeper checklist on head 1a66672:

  • Save rollback now marks the staged telemetry transaction for recovery before restoring credentials and the disconnect marker.
  • Removal rollback uses the same recovery marker, so a marker-reset failure cannot make staged artifacts look committed.
  • Added focused tests for both failed marker-rollback paths and next-lock recovery.

Verification: focused CLIProxyAPIUsageCacheTests passed; make check passed; full make test passed all 828 selections across 69 groups with no retries or failures.

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1a66672e28

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/CostUsageCacheLocations.swift
@EClinick

EClinick commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the exact-head Codex P2 on c694017:

  • Journal credential-rollback success in the artifacts transaction manifest before marker and artifact rollback.
  • Recovery restores staged old telemetry only when credential restoration was durably recorded.
  • If credential rollback was not confirmed, recovery discards the staged old telemetry and keeps the integration explicitly disconnected.
  • Extended the failed-credential rollback test through the next-lock recovery path.

Verification: focused CLIProxyAPIUsageCacheTests passed; make check passed; full make test passed all 828 selections across 69 groups with no retries or failures. Both handled Codex threads have disposition replies and are resolved.

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c694017bf6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBar/SpendDashboardController.swift
@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 Merging this PR could lose, corrupt, stale, or mis-associate session or agent state. and removed merge-risk: 🚨 session-state 🚨 Merging this PR could lose, corrupt, stale, or mis-associate session or agent state. labels Aug 6, 2026

EClinick commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the canonical ClawSweeper P2 cancellation finding in 8441b9a6: a cancelled CLIProxyAPI snapshot load now invalidates codex:cliproxyapi, so the controller cannot retain stale proxy spend across a configuration boundary. Added a retained-row regression test; focused tests, repository checks, and all 828 test selections pass.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 8441b9a65a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

EClinick commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Canonical finding fixed on exact head 8441b9a65a36b03b6838623bf58ae520ed31f5a0; the automatic review workflow completed but durable comment 5081410241 did not refresh.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 9, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@EClinick

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0f971cad1a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/CLIProxyAPIUsageTelemetry.swift
@EClinick

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5b12543b40

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/CLIProxyAPIUsageTelemetry.swift
@EClinick

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 68c572034e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/CostUsageCacheLocations.swift Outdated
@EClinick

Copy link
Copy Markdown
Contributor Author

@codex review

@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown

ClawSweeper status: review started.

I am starting a fresh review of this pull request: Add CLIProxyAPI cost attribution This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 92ef1978dc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


let scanOptions = options
let proxyDaily = try await CostUsageScanExecutor.run { checkCancellation in
let range = CostUsageScanner.CostUsageDayRange(since: since, until: request.now)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the configured calendar for proxy scan ranges

When the dashboard's bucket timezone differs from the Mac's current timezone, this initializer silently uses .current even though since, the scanner options, and the final snapshot use options.calendar. Near a day boundary, proxy-attributed rows can therefore be assigned to or filtered by the wrong day, and the shared Claude cache is saved with the system timezone rather than the configured bucket timezone. Pass scanOptions.calendar into this range as the other scan paths do.

Useful? React with 👍 / 👎.

Comment on lines +699 to +700
case .missing:
KeychainCacheStore.clear(key: self.key)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Treat missing credentials as a successful rollback

Fresh evidence beyond the resolved removal path is that an initial save with no previous credential still restores .missing through KeychainCacheStore.clear, which returns false when the item is already absent (KeychainCacheStore.swift:254-255). If the Keychain store fails without creating an item, rollback consequently stops before restoring the disconnect marker and staged artifacts; recovery then treats credential rollback as unconfirmed, discards any staged telemetry, and leaves the integration explicitly disconnected. Accept both .removed and .missing from clearResult here.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 auth-provider 🚨 Merging this PR could break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants